package com.pushbox.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pushbox.dao.UserLoginMapper;
import com.pushbox.model.UserLogin;
import com.pushbox.service.LoginService;

/**
 * Created by Hatcher on 2016/9/22 0022.
 */
@Service("loginService")
public class LoginServiceImpl implements LoginService {
	@Autowired
	private UserLoginMapper userLoginMapper;

	public Integer isLogin(UserLogin userLogin) {
		List<UserLogin> result = userLoginMapper.selectByUserLogin(userLogin);
		if (result.size() == 1) {
			return result.get(0).getUserId();
		}
		return null;
	}
}
